package com.kaipizhe.controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class ApiController {

    @PostMapping("/items")
    public Object items(@RequestBody Object data) {
        return data;
    }

    @GetMapping("/items/{id}")
    public Object idItems(@PathVariable Long id) {
        return id;
    }

    @GetMapping("/items/type")
    public Object typeItems() {
        return "type";
    }

    @GetMapping("/items/type/{id}")
    public Object idTypeItems(@PathVariable Long id) {
        return "type";
    }

    @PutMapping("/items/{id}/edit")
    public Object editIdItems(@PathVariable String id, @RequestBody Object data) {
        return data;
    }

    @DeleteMapping("/items/{id}")
    public Object deleteItems(@PathVariable Long id) {
        return id;
    }

}
